package org.llc.authorization.controller;

import io.swagger.annotations.Api;
import org.llc.authorization.dto.ClientsDTO;
import org.llc.authorization.service.MyBatisClientDetailsServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

//import javax.validation.Valid;

/**
 * Client管理Controller
 *
 * @author llc
 * @date 2020/1/16 10:25
 * @since 1.0.0
 */
@Api(tags = "客户端管理")
@RestController
public class ClientsController {

    /**
     * 客户端Service
     */
    private final MyBatisClientDetailsServiceImpl myBatisClientDetailsServiceImpl;

    public ClientsController(MyBatisClientDetailsServiceImpl myBatisClientDetailsServiceImpl) {
        this.myBatisClientDetailsServiceImpl = myBatisClientDetailsServiceImpl;
    }

    /**
     * 新增客户端
     *
     * @param clients 新增客户端内容
     * @return java.lang.Object
     * @author llc
     * @date 2020/1/20 10:41
     */
    @PostMapping("oauth/client/insert")
    public Object insert( @RequestBody ClientsDTO clients) {
        return myBatisClientDetailsServiceImpl.insert(clients);
    }

}

